<template>
  <div style="background-color: white">
    <el-tag size="medium" style="height: 42px;margin-left: 10px;margin-top: 15px;">车辆申请信息</el-tag>
    <el-form :model="formData" ref="vForm" :rules="rules" label-position="left" label-width="60px"
             size="default" @submit.prevent>
      <el-row>
        <el-col :span="5" :offset="1" class="grid-cell">
          <el-form-item label="姓名：" prop="empName" class="label-right-align">
            <el-input v-model="search.empName" type="text" clearable @change="cha" ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="3" class="grid-cell" style="margin-left: 10px">
          <el-button type="primary" plain @click="cha">查找</el-button>
        </el-col>
      </el-row>
      <div class="static-content-item"  style="padding-bottom: 20px;margin-top: -20px">
        <el-divider direction="horizontal">申请信息如下</el-divider>
        <div>
          <el-table :data="tableData" style="width: 100%" :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }" height="486">
            <el-table-column label="编号" prop="id" width="55" v-if="show" type="index"/>
            <el-table-column label="流程编号" prop="processId"/>
            <el-table-column label="车牌号" prop="licensePlate"/>
            <el-table-column label="车辆名称" prop="brand"/>
            <el-table-column label="申请人" prop="empName"/>
            <el-table-column label="申请部门" prop="deptName"/>
            <el-table-column label="申请时间" prop="createTime"/>
            <el-table-column label="开始时间" prop="startTime"/>
            <el-table-column label="结束时间" prop="endTime"/>
            <el-table-column label="当前状态" prop="status">
              <template #default="e">
                <template v-if="e.row.status===0">
                  <el-tag >申请中</el-tag>
                </template>
                <template v-if="e.row.status===1">
                  <el-tag type="success">待领用</el-tag>
                </template>
                <template v-if="e.row.status===2">
                  <el-tag type="danger">未通过</el-tag>
                </template>
                <template v-if="e.row.status===3">
                  <el-tag type="warning">使用中</el-tag>
                </template>
                <template v-if="e.row.status===4">
                  <el-tag type="info">已归还</el-tag>
                </template>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>

    </el-form>
  </div>
</template>

<script>

import {defineComponent} from "vue";
import {
  addVehicleRecord,
  shenqingdaipizhun,
  updateStatus, updatevehicle
} from "../../../network/adm/vehicle";
import {carAll} from "../../../network/process/vehicle-process";

export default defineComponent( {
  data() {
    return {
      show:true,
      search:{
        empName:null
      },
      tableData: [],
    }
  },
  methods: {
    //申请记录查询
    shenqingdaipizhun(){
      let params={
        empName:null
      }
      shenqingdaipizhun(params).then(data=>{
        console.log("申请信息记录：",data)
        this.tableData = data.data;
      })
    },
    //搜索
    cha(){
      this.shenqingdaipizhun()
    },
    handleEdit(row) {
      console.log("选中当前行的值",row)

    },
    handleEdit_1(row) {
      console.log("选中当前行的值",row)

    },
    handleDelete(index, row) {
      console.log(index, row)
    },
  },
  created() {
    this.shenqingdaipizhun();
  }
})
</script>


<style scoped>

</style>